-
Notifications
You must be signed in to change notification settings - Fork 3
feat: POC add library problem #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: POC add library problem #35
Conversation
|
Thanks for the pull request, @Henrrypg! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
==========================================
+ Coverage 75.00% 75.78% +0.78%
==========================================
Files 22 28 +6
Lines 1024 1425 +401
Branches 68 82 +14
==========================================
+ Hits 768 1080 +312
- Misses 244 330 +86
- Partials 12 15 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5b86d69 to
591df56
Compare
0d5d1cd to
53a9c9e
Compare
a7d0c85 to
38b7919
Compare
|
@Henrrypg I gave this POC some time today and I fixed some of the most oustanding issues.
I also did some minor refactors on the callAIService function to make it more general. From my perspective, this PR still needs:
|
1bbcd14 to
b62ac25
Compare
|
@felipemontoya I can't check the previous points, but all of them should be addressed. I keep some extra points:
|
I would not care too much about this, since we are going to solve it once we make prompts be overridable via model.
We can focus on merging the chat feature first and then we'll rebase this on top |
a9c1a5f to
323a880
Compare
cc22a09 to
601bb77
Compare
|
This is getting so close. In our last call we saw 3 things missing
|
4cf0d10 to
5eb25df
Compare
a023447 to
cfc3e21
Compare
felipemontoya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed some openedx imports that we would need to make dynamic in the same pattern we have used for other plugins in the past. E.g https://github.com/eduNEXT/eox-tenant/blob/master/eox_tenant/edxapp_wrapper/edxmako_module.py
| def create_block(self, data): | ||
| """Create a library block.""" | ||
| # pylint: disable=import-error, import-outside-toplevel | ||
| from openedx.core.djangoapps.content_libraries import api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed this, but I think we need to solve before merge. For this the best would be to use the backend pattern we use in many other plugins
| def modify_block_olx(self, usage_key, data): | ||
| """Modify the OLX of a library block.""" | ||
| # pylint: disable=import-error, import-outside-toplevel | ||
| from openedx.core.djangoapps.content_libraries import api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
|
|
||
| self.update_submission(messages) | ||
|
|
||
| def update_submission(self, data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we should be storing the current data in a submission, but instead in the session. The submission would be for what we sent do the llm and what comes back
felipemontoya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has reached a good for v1 status. I think we can merge and deploy to see it in action at the sandbox
bde069e to
5ed8fe9
Compare
5ed8fe9 to
c54cf4f
Compare

This pull request introduces a new AI-powered educator assistant workflow for generating quiz questions in Open edX, integrating a custom processor and orchestrator, and improving configuration and utility support for content libraries. The most important changes are grouped below:
Educator Assistant Workflow Integration
EducatorAssistantProcessorclass, which uses LiteLLM to generate quiz questions based on course unit content, formats questions in OLX, and adds them to content libraries. Includes robust prompt handling, error management, and JSON output enforcement. (backend/openedx_ai_extensions/processors/educator_assistant_processor.py)EducatorAssistantOrchestratorto orchestrate the workflow: it extracts unit content, invokes the educator assistant processor, and returns a link to the generated questions in the content library. (backend/openedx_ai_extensions/workflows/orchestrators.py)EducatorAssistantProcessorin the processors module for proper import and usage. (backend/openedx_ai_extensions/processors/__init__.py)Content Library Utilities
ContentLibraryHelperclass to encapsulate operations for creating collections, blocks, and updating items in content libraries, supporting the educator assistant’s output integration. (backend/openedx_ai_extensions/processors/content_libraries_utils.py)Configuration and Prompt Enhancements
backend/openedx_ai_extensions/prompts/default_generate_quiz_questions.txt)default_cms.json) for the educator assistant, defining processor, actuator, and UI component settings for CMS usage. (backend/openedx_ai_extensions/workflows/configs/default_cms.json)default_cms.jsonwhen running in CMS context, enabling context-specific workflows. (backend/openedx_ai_extensions/workflows/configs/mock_functions.py)Testing and Miscellaneous
BlockUsageLocatorfor unit IDs, ensuring realistic context in API workflow tests. (backend/tests/test_api.py) [1] [2]backend/openedx_ai_extensions/workflows/configs/openai_hello.json) [1] (backend/openedx_ai_extensions/settings/production.py) [2]These changes collectively enable course authors to use an integrated AI assistant to automatically generate and add assessment questions to their content libraries, improving authoring efficiency and instructional quality.